class Railify < ActiveRecord::Migration

  def self.up
    rename_table :dgmAttributeTypes, :properties
    rename_column :properties, :attributeID, :id
    rename_column :properties, :graphicID, :graphic_id
    rename_column :properties, :attributeCategory, :category_id
    rename_column :properties, :maxAttributeID, :maxPropertyID
    rename_column :properties, :attributeIdx, :propertyIdx

    rename_table :dgmTypeAttributes, :items_properties
    rename_column :items_properties, :typeID, :item_id
    rename_column :items_properties, :attributeID, :property_id
  
    rename_table :invTypes, :items
    rename_column :items, :typeID, :id
    rename_column :items, :groupID, :group_id
    rename_column :items, :typeName, :name
    rename_column :items, :graphicID, :graphic_id
    rename_column :items, :marketGroupID, :marketgroup_id
    
    rename_table :dgmTypeEffects, :effects_items
    rename_column :effects_items, :typeID, :item_id
    rename_column :effects_items, :effectID, :effect_id
    
    rename_table :dgmEffects, :effects
    rename_column :effects, :effectID, :id
    rename_column :effects, :effectName, :name
    rename_column :effects, :graphicID, :graphic_id
    
    rename_table :invGroups, :groups
    rename_column :groups, :groupID, :id
    rename_column :groups, :categoryID, :category_id
    rename_column :groups, :groupName, :name
    
    rename_table :invCategories, :categories
    rename_column :categories, :categoryID, :id
    rename_column :categories, :categoryName, :name   
    rename_column :categories, :graphicID, :graphic_id
    
    rename_table :invMarketGroups, :marketgroups
    rename_column :marketgroups, :marketGroupID, :id
    rename_column :marketgroups, :parentGroupID, :partent_id
    rename_column :marketgroups, :marketGroupName, :name
    rename_column :marketgroups, :graphicID, :graphic_id
    
    rename_table :invBlueprintTypes, :blueprints
    rename_column :blueprints, :blueprintTypeID, :id
    rename_column :blueprints, :parentBlueprintTypeID, :partent_id
    rename_column :blueprints, :productTypeID, :item_id
    
    rename_table :TL2MaterialsForTypeWithActivity, :materials
    rename_column :materials, :typeID, :item_id
    rename_column :materials, :requiredTypeID, :requiredType_id 

		rename_table :mapsolarsystems, :solarsystems
		rename_column :solarsystems, :regionID, :region_id
		rename_column :solarsystems, :constellationID, :constellation_id
		rename_column :solarsystems, :solarSystemID, :id
		rename_column :solarsystems, :solarSystemName, :name

		rename_table :mapregions, :regions
		rename_column :regions, :regionID, :id
		rename_column :regions, :regionName, :name
		rename_column :regions, :factionID, :faction_id

		rename_table :mapuniverse, :universes
		rename_column :universes, :universeID, :id
		rename_column :universes, :universeName, :name

		rename_table :mapconstellations, :constellations
		rename_column :constellations, :regionID, :region_id
		rename_column :constellations, :constellationID, :id
		rename_column :constellations, :constellationName, :name
		rename_column :constellations, :factionID, :faction_id
		rename_column :constellations, :allianceID, :alliance_id

		rename_table :mapsolarsystemjumps, :solarsystems_jumps
		rename_column :solarsystems_jumps, :fromRegionID, :from_region
		rename_column :solarsystems_jumps, :fromconstellationID, :from_constellation
		rename_column :solarsystems_jumps, :fromSolarsystemID, :solarsystem_id
		rename_column :solarsystems_jumps, :toSolarsystemID, :jump_id
		rename_column :solarsystems_jumps, :toConstellationID, :to_constellation
		rename_column :solarsystems_jumps, :toRegionID, :to_region
	end

  def self.down
  end
end
